import Http from '../http';

export const getAllLinks = function() {
    return Http.get('/api/dblink/list')
}

export const getAllLinksTress = function() {
    return Http.get('/api/dblink/list_exe')
}

export const getLinkDetail = function(params: any) {
    return Http.get('/api/dblink/detail', params)
}

export const addNodeOrLink = function(data: any) {
    return Http.post('/api/dblink/add', data)
}

export const updateLink = function(data: any) {
    return Http.post('/api/dblink/update', data)
}

export const deleteLink = function(params: any) {
    return Http.get('/api/dblink/delete', params)
}

export const linkTest = function(data: any) {
    return Http.post('/api/dblink/test', data)
}

export const getSourceTypes = function() {
    return Http.get('/api/dblink/get_database_type')
}

export const queryAllBases = function(data: any) {
    return Http.post('/api/dbutil/show_database', data)
}

export const queryAllTables = function(data: any) {
    return Http.post('/api/dbutil/show_table', data)
}

export const queryAllColumnTree = function(data: any) {
    return Http.post('/api/dbutil/show_column', data)
}

export const queryAllColumn = function(data: any) {
    return Http.post('/api/dbutil/column', data)
}

export const selectCount = function(data: any) {
    return Http.post('/api/dbutil/select/count', data)
}

export const actSelectSql = function(data: any) {
    return Http.post('/api/dbutil/select', data)
}

export const countColumn = function(data: any) {
    return Http.post('/api/dbutil/column/count', data)
}